package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

public class ResponseContext implements Sequenceable, Serializable {


    @SerializedName("serviceTrackingParams")
    private List<ServiceTrackingParamsItem> serviceTrackingParams;

    @SerializedName("webResponseContextExtensionData")
    private WebResponseContextExtensionData webResponseContextExtensionData;

    @SerializedName("mainAppWebResponseContext")
    private MainAppWebResponseContext mainAppWebResponseContext;


    public static final Sequenceable.Producer<ResponseContext> CREATOR = new Producer<ResponseContext>() {
        @Override
        public ResponseContext createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            ResponseContext responseContext = new ResponseContext();
            responseContext.unmarshalling(parcel);
            return responseContext;
        }
    };


    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeList(this.serviceTrackingParams);
        parcel.writeSequenceable(this.webResponseContextExtensionData);
        parcel.writeSequenceable(this.mainAppWebResponseContext);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.serviceTrackingParams = parcel.readSequenceableList(ServiceTrackingParamsItem.class);
        parcel.readSequenceable(this.webResponseContextExtensionData);
        parcel.readSequenceable(this.mainAppWebResponseContext);
        return true;
    }

    @Override
    public String toString() {
        return "ResponseContext{" +
                "serviceTrackingParams=" + serviceTrackingParams +
                ", webResponseContextExtensionData=" + webResponseContextExtensionData +
                ", mainAppWebResponseContext=" + mainAppWebResponseContext +
                '}';
    }


    public List<ServiceTrackingParamsItem> getServiceTrackingParams() {
        return serviceTrackingParams;
    }

    public void setServiceTrackingParams(List<ServiceTrackingParamsItem> serviceTrackingParams) {
        this.serviceTrackingParams = serviceTrackingParams;
    }

    public WebResponseContextExtensionData getWebResponseContextExtensionData() {
        return webResponseContextExtensionData;
    }

    public void setWebResponseContextExtensionData(WebResponseContextExtensionData webResponseContextExtensionData) {
        this.webResponseContextExtensionData = webResponseContextExtensionData;
    }

    public MainAppWebResponseContext getMainAppWebResponseContext() {
        return mainAppWebResponseContext;
    }

    public void setMainAppWebResponseContext(MainAppWebResponseContext mainAppWebResponseContext) {
        this.mainAppWebResponseContext = mainAppWebResponseContext;
    }
}
